const TodoInput = {
  template: `
    <div class="input">
      <input
        type="text"
        placeholder="请输入新待办事项"
        ref="inputRef"
      >
      <button class="add" @click="handleAdd">添加</button>
    </div>
  `,
  methods: {
    // 添加新待办事项，向父组件传递文本框中输入的值
    handleAdd() {
      this.$emit('add', '要传递的新待办事项标题')
    },
  },
}

export default TodoInput
